//
//  XCViewController.m
//  XCCategory_OC
//
//  Created by guoshuai.cheng@holla.world on 03/27/2023.
//  Copyright (c) 2023 guoshuai.cheng@holla.world. All rights reserved.
//

#import "XCViewController.h"
#import <XCCategory_OC/UIImage+XCBlur.h>

@interface XCViewController ()<UIImagePickerControllerDelegate>
@property (weak, nonatomic) IBOutlet UIImageView *iamgeView;

@end

@implementation XCViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)choose:(id)sender {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
    picker.delegate = self;
    picker.allowsEditing = NO;
    picker.mediaTypes = @[@"public.image"];

    [self presentViewController:picker animated:YES completion:nil];
    
}


- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    UIImage *image = info[UIImagePickerControllerOriginalImage];
    [picker dismissViewControllerAnimated:NO completion:nil];
//    self.iamgeView.image = [image blurredImageWithRadius:20 iterations:20 tintColor:UIColor.clearColor];
    self.iamgeView.image = [image gaussianDeep:300];

    

}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
    [picker dismissViewControllerAnimated:NO completion:nil];
}

@end
